<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #div1{
            width: 468px;
            height: 468px;
            padding: 10px;
            border: 1px solid red;
        }
    </style>
</head>
<body>
    <div id="div1" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
    <img src="img/lankou.jpg" alt="" id="drag1" ondragstart="drag(event)" >
    <script>
        function allowDrop(ev){
            ev.preventDefault()
        }
        function drop(ev){
            ev.dataTransfer.setData("myimg",ev.target.id)
        }
        function drag(ev){
            ev.preventDefault()
            var data=ev.dataTransfer.getData("Text")
            ev.target.appendChild(document.getElementById(data))
        }
    </script>

</body>
</html>